require "ImguiWin/BaseImguiWindow"
require "UnityEngine.SystemInfo"

local P = NewClass(BaseImguiWindow, ClassFromFile(...));

local GUILayout = UnityEngine.GUILayout
local GUI = UnityEngine.GUI
local Screen = UnityEngine.Screen

local showFields =
{
	"width",
	"height",
	"fullScreen",
	"dpi",
	"orientation",
	"sleepTimeout",
	"autorotateToLandscapeLeft",
	"autorotateToLandscapeRight",
	"autorotateToPortrait",
	"autorotateToPortraitUpsideDown",
}

local scrollPos = Vector2.zero

function P:OnGUI()
	GUIFun.Init()
	GUILayout.Box("", GUILayout.Height(Screen.height), GUILayout.Width(Screen.width))
	self:Show()
end

function P:Show()
	local space = 0
	GUILayout.BeginArea(self:GetFullScreenAreaRect())
	GUILayout.BeginVertical()

	scrollPos = GUILayout.BeginScrollView(scrollPos, false, true, GUILayout.Width(Screen.width));
	GUILayout.BeginVertical()
	for i = 1, #showFields do
		if GUIFun.Button(showFields[i]..": "..tostring(UnityEngine.Screen[showFields[i]]), false, 0) then
			UniClipboard.SetText(tostring(UnityEngine.Screen[showFields[i]]))
		end
	end
	GUILayout.EndVertical()
	GUILayout.EndScrollView()

	GUILayout.BeginHorizontal()
	if GUILayout.Button("close", GUIFun.Height(100)) then
		self._funObj:Close()
	end
	GUILayout.EndHorizontal()

	GUILayout.EndVertical()
	GUILayout.EndArea()
end
